<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<h1>获取元素内容</h1>
<hr>

<div id="box">
    <span><em>SPAN1</em></span>
</div>

<script>
    let node = document.getElementById("box");
    console.log(node.innerText);
    console.log(node.innerHTML);
</script>
</body>
</html>